﻿#pragma once
#include "GigECam.h"

// CGigeCamSettingDlg 对话框
using namespace cv;
class CGigeCamSettingDlg : public CDialogEx
{
	DECLARE_DYNAMIC(CGigeCamSettingDlg)

public:
	CGigeCamSettingDlg(CWnd* pParent = nullptr);   // 标准构造函数
	virtual ~CGigeCamSettingDlg();

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_DIALOG_GIGECAM };
#endif

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()
public:
	void ReadEditValueToConfig();
	void ReadConfigToEditValue();
	afx_msg void OnBnClickedButtonOpenDevice();
	CGigECam m_cGigeCam;
	virtual void OnCancel();
	virtual BOOL OnInitDialog();
	CComboBox m_comboCamName;
	afx_msg void OnBnClickedButtonInit();
	unsigned int __stdcall CamDisplayThread();
	afx_msg void OnBnClickedButtonCloseDevice();
	afx_msg void OnBnClickedRadioContinueMode();
	afx_msg void OnBnClickedRadioTriggerMode();
	afx_msg void OnBnClickedButtonStartGrab();
	afx_msg void OnBnClickedButtonStopGrab();

	union UI_Proc
	{
		unsigned(_stdcall * ThreadProc)(void*);
		unsigned(_stdcall CGigeCamSettingDlg::*MemProc)();
	}CamDisplay;

	CButton m_radioContinueMode;
	CButton m_radioTriggerMode;
	afx_msg void OnBnClickedSoftwareOnceButton();
	afx_msg void OnBnClickedButtonSaveBmp();
	afx_msg void OnBnClickedButtonSetPara();
	float m_fExposureTime;
	float m_fGain;
};
